package com.ai.service.made.impl;

import com.ai.entity.made.Pictures;
import com.ai.mapper.made.PicturesMapper;
import com.ai.service.made.IPicturesService;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.nio.file.Path;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chen
 * @since 2023-03-28 11:12:30
 */
@Service
public class PicturesServiceImpl extends ServiceImpl<PicturesMapper, Pictures> implements IPicturesService {

    @Override
    public void updateDownloadPicture(Path toPath, String pictureId) {
        update(new UpdateWrapper<Pictures>().eq("id",pictureId)
                .set("picture_local_url",toPath.toString())
                .set("local_flag","1"));
    }
}
